home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / oath.lha / oath / test / bimul.cc < prev    next >
C/C++ Source or Header  |  1991-08-29  |  921b  |  29 lines

  1. #include "oath/bigInteger.h"
  2.  
  3. #include <iostream.h>
  4.  
  5. main(int argc, char **argv)
  6.    {if(argc != 3)
  7.        {cout << argv[0] << " reads two bigInteger's and produces sums.\n";
  8.         cout << "Usage: " << argv[0] << " <integer> <integer>\n";
  9.         exit(1);
  10.        }
  11.  
  12.     bigIntegerA X = bigIntegerA::make(argv[1]);
  13.     bigIntegerA Y = bigIntegerA::make(argv[2]);
  14.  
  15.     cout << "       X = " << X << endl;
  16.     cout << "       Y = " << Y << endl;
  17.  
  18.     cout << "(X *= Y) = " << (X *= Y) << endl;
  19.     cout << "(X *= Y) = " << (X *= Y) << endl;
  20.     cout << "(X *= Y) = " << (X *= Y) << endl;
  21.     cout << "(X /= Y) = " << (X /= Y) << endl;
  22.     cout << "(X /= Y) = " << (X /= Y) << endl;
  23.     cout << "(X /= Y) = " << (X /= Y) << endl;
  24.     cout << "(X %  Y) = " << (X %  Y) << endl;
  25.     cout << "(X /= Y) = " << (X /= Y) << endl;
  26.     cout << "(X %  Y) = " << (X %  Y) << endl;
  27.     cout << "(X /= Y) = " << (X /= Y) << endl;
  28.    }
  29.